using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Lists;

namespace QLKDMain.HoSo
{
    public partial class FrmTrangThaiNghiKinhDoanh : DevExpress.XtraEditors.XtraForm
    {
        protected HoSoDangKy _HoSoDangKy;
        public FrmTrangThaiNghiKinhDoanh(HoSoDangKy _hoSoDangKy)
        {
            InitializeComponent();
            _HoSoDangKy = _hoSoDangKy;
        }

        private void FrmTrangThaiNghiKinhDoanh_Load(object sender, EventArgs e)
        {
            if (_HoSoDangKy.NgayNghiKD is DateTime?) dateNgayNghiKinhDoanh.EditValue = _HoSoDangKy.NgayNghiKD;
            else dateNgayNghiKinhDoanh.EditValue = null;
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            if (dateNgayNghiKinhDoanh.EditValue != null)
            {
                HoSoDangKy hs = _HoSoDangKy;
                hs.NgayNghiKD = dateNgayNghiKinhDoanh.DateTime;
                //Thoi hoat dong
                hs.TrangThaiHS = 4;
                hs.UpdateToDB();
            }
            this.Close();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}